﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;
using Rhino.Mocks;

namespace Chambills.Present.Validation.Tests
{
    
    public class DefaultViewModelValidatorTestCase
    {
        [TestFixture]
        public class WhenValidationIsDisabledOnDefaultViewModelValidator
        {
            [Test]
            public void NoErrorsReturnedForInvalidProperty()
            {
                var inner = MockRepository.GenerateStub<IViewModelValidationContributor>();
                var validator = new DefaultViewModelValidator(inner);
                inner.Stub(x => x.GetErrorsForProperty("badProperty")).Return(new List<string> { "Error" });
                validator.Enabled = false;
                Assert.IsEmpty(validator.Error);
            }

        }
    }
}
